package data;

/**
 * Data holder for user accounts
 * 
 * @author Kelsey
 */
public class Account {

	/** Account's username as a String */
	private String accountName;

	/** Account's email as a String */
	private String email;

	/** Account's password as a String. password is not encrypted */
	private String password;

	/** The real name of the Account's user */
	private String realName;

	/** Phone number of Account's user */
	private String phoneNumber;

	/** Increments when login fails. Resets to 0 when login succeeds */
	private int loginTimes;

	/** Whether or not the account can be used */
	private boolean isLocked;

	/** whether or not the account is an admin */
	private boolean isAdmin;

	/**
	 * gets accountName as String
	 * 
	 * @return accountName
	 */
	public String getAccountName() {
		return accountName;
	}

	/**
	 * this sets the account name
	 * 
	 * @param accountName
	 *            the new account name
	 */
	public void setAccountName(String accountName) {
		this.accountName = accountName;
	}

	/**
	 * this gets the user's email as String
	 * 
	 * @return email
	 */
	public String getEmail() {
		return email;
	}

	/**
	 * set the user's email
	 * 
	 * @param email
	 *            new email
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * gets the account's unencrypted password as String
	 * 
	 * @return password
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * sets the account's password
	 * 
	 * @param password
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * gets the real name of the account holder
	 * 
	 * @return the real name of the account holder
	 */
	public String getRealName() {
		return realName;
	}

	/**
	 * sets the real name of the account
	 * 
	 * @param realName
	 */
	public void setRealName(String realName) {
		this.realName = realName;
	}

	/**
	 * gets the phone number of the account
	 * 
	 * @return phoneNumber
	 */
	public String getPhoneNumber() {
		return phoneNumber;
	}

	/**
	 * sets the phone number of the account
	 * 
	 * @param phoneNumber
	 */
	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	/**
	 * gets the number of times login failed since last succcess
	 * 
	 * @return loginTimes
	 */
	public int getLoginTimes() {
		return loginTimes;
	}

	/**
	 * sets loginTimes
	 * 
	 * @param loginTimes
	 */
	public void setLoginTimes(int loginTimes) {
		this.loginTimes = loginTimes;
	}

	/**
	 * set if the account is locked
	 * 
	 * @param locked
	 *            if the account is locked
	 */
	public void setIsLocked(boolean locked) {
		this.isLocked = locked;
	}

	/**
	 * return if the account is locked
	 * 
	 * @return if the account is locked
	 */
	public boolean getIsLocked() {
		return this.isLocked;
	}

	/**
	 * set is the account is an admin
	 * 
	 * @param admin
	 *            if the account is an admin
	 */
	public void setIsAdmin(boolean admin) {
		this.isAdmin = admin;
	}

	/**
	 * get if the account is an admin
	 * 
	 * @return if the accoun is an admin
	 */
	public boolean getIsAdmin() {
		return this.isAdmin;
	}

	// public boolean add() throws DBInterfaceError{
	// return new AddAccount(this).getResult();
	// }
	//
	// public boolean exists() throws DBInterfaceError {
	// return new AccountExists(this).getResult();
	// }
	//
	// public boolean correctCredentials() throws DBInterfaceError{
	// return new AccountCorrectCredentials(this).getResult();
	// }
	//
	// public boolean isLocked() throws DBInterfaceError{
	// return new AccountIsLocked(this).getResult();
	// }

}
